public class bble
{
   public static void main(String args[])
	 {
           		  int[] n = {32, 39,21, 45, 23, 3};
      		  bubbleSort(n);
		 for(int j= 0; j<n.length; j++)
		{
     		 	System.out.println("unsorted array aftersorting:"+n[j]); 
 	  	}
	}  
  public static int[] bubbleSort(int[] n)
  {
            
                for(int i=1; i<n.length; i++)
	{
               		 for(int j= 0; j<n.length -1; j++)
		{
               			 if(n[j]> n[j+1])
			{
                   			 int temp = n[j];
                   			 n[j] = n[j+1];
                   			 n[j+1] = temp;
               			 }
          		  
		}
		
                		
		
                }return n;
   }

}

